package cn.lg.soar.boot.fc.entity.bo;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 单元表
 * @author ZhuanZ（无密码）
 * @since 2025-01-10
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "Unit", description = "单元表")
public class UnitBo extends BaseEntity {

    /**  */
    @ApiModelProperty(value = "主键")
    private Long id;

    /** 校区ID */
    @ApiModelProperty(value = "校区ID")
    private Long campusId;

    /** 楼栋ID */
    @ApiModelProperty(value = "楼栋ID")
    private Long buildingId;

    /** 单元名称 */
    @NotBlank(message = "单元名称为空", groups = { Create.class, Update.class })
    @ApiModelProperty(value = "单元名称")
    private String name;

    /** 单元图片 */
    @ApiModelProperty(value = "单元图片")
    private String img;

    /** 单元面积 */
    @ApiModelProperty(value = "单元面积")
    private String area;

    /** 附件 */
    @ApiModelProperty(value = "附件")
    private String attachment;

    /** 排序 */
//    @NotNull(message = "排序不能为空", groups = { Create.class, Update.class })
    @ApiModelProperty(value = "排序")
    private Integer orders;

    /** 扩展字段1 */
    @ApiModelProperty(value = "扩展字段1")
    private String extend1;

    /** 扩展字段2 */
    @ApiModelProperty(value = "扩展字段2")
    private String extend2;

    /** 扩展字段3 */
    @ApiModelProperty(value = "扩展字段3")
    private String extend3;

    @ApiModelProperty(value = "节点id")
    private String parentId;

    /** 乐观锁 */
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    @JsonIgnore
    public Long primaryKey() {
        return this.id;
    }

}
